package com.alipay.sofa.award.endpoint.facade;

import com.alipay.sofa.award.common.dal.dataobject.UserInfo;
import com.alipay.sofa.award.endpoint.constants.RestConstants;
import com.alipay.sofa.award.endpoint.constants.URLConstants;
import com.alipay.sofa.award.endpoint.response.RestSampleFacadeResp;
import org.jboss.resteasy.spi.HttpResponse;

import javax.ws.rs.*;
import javax.ws.rs.core.Context;

/**
 * AuthFacade
 *
 * @author yangguanchao
 * @since 2018/09/05
 */
@Path(URLConstants.OPENAPI_PREFIX)
@Consumes(RestConstants.DEFAULT_CONTENT_TYPE)
@Produces(RestConstants.DEFAULT_CONTENT_TYPE)
public interface AuthFacade {

    /**
     * Auth
     * http://localhost:8341/openapi/auth?authCode=XXX
     * @param authCode authCode
     * @param response
     * @return
     * @throws Exception
     */
    @GET
    @Path("/auth")
    RestSampleFacadeResp<UserInfo> authUser(@QueryParam("authCode") String authCode,
                                            @Context HttpResponse response) throws Exception;

}
